﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Xml.Serialization;

namespace DataAccessLayer
{
    [Serializable, XmlType("Asset")]
    public sealed class XmlFont
    {
        /// <summary>
        /// Do not touch this object.
        /// </summary>
        [XmlAttribute]
        public string Type { get; set; }

        [XmlElement]
        public string FontName { get; set; }

        [XmlElement]
        public int Size { get; set; }

        [XmlElement]
        public int Spacing { get; set; }

        [XmlElement]
        public bool UseKerning { get; set; }

        [XmlElement]
        public string Style { get; set; }

        [XmlIgnore]
        public FontStyle FontStyle { get; set; }

        /// <summary>
        /// Do not touch this object.
        /// </summary>
        [XmlArray("CharacterRegions")]
        public List<CharacterRegion> CharacterRegions { get; set; }

        public XmlFont()
        {
            Type = "Graphics:FontDescription";
            FontName = "Times New Roman";
            Size = 12;
            Style = FontStyle.Regular.ToString();
            FontStyle = FontStyle.Regular;
            UseKerning = true;
            CharacterRegions = new List<CharacterRegion>
                                   {
                                       new CharacterRegion
                                           {
                                               Start = "&#32;",
                                               End = "&#126;"
                                           }
                                   };
        }
    }
}